/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  CCell, Cell, Table, TableBody, TableRow, Text
} from "customize-easy-ui-component";
import { DirectLink } from "../../../routing/Link";
import {检验结论IndNj, } from "../viewRes";

//整个结论报告页
export const 检验结论报告= ({ orc, rep,theme } : { orc: any, rep: any,theme:any}
) => {
  return <>
    <Text id={'Conclusion'} variant="h2" css={{textAlign:'center',
      "@media print": {
        pageBreakBefore: 'always',
      },
    }}>工业管道年度检查结论报告</Text>
    <Text css={{display: 'flex',flexDirection: 'row-reverse',marginRight: '2rem'
    }}>报告编号：{rep.isp?.no}</Text>
    <Table fixed={ ["4%","15%","34%","16%","%"]  } css={ {borderCollapse: 'collapse' } }  tight  miniw={800}>
      <TableBody>
        <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Survey#Survey`}>
        <TableRow>
          <CCell  scope="row" colSpan={2}>管道名称</CCell>
          <CCell>{orc.管道设备名}</CCell>
          <CCell>管道级别</CCell>
          <CCell>{orc.管道级别}</CCell>
        </TableRow>
        <TableRow>
          <CCell  colSpan={2}>起始—终止位置</CCell>
          <CCell>{orc.起始终止}</CCell>
          <CCell>单位内编号</CCell>
          <CCell>{orc.单位内编号}</CCell>
        </TableRow>
        <TableRow >
          <CCell colSpan={2}>使用登记证编号</CCell>
          <CCell colSpan={3}>{orc.使用证号}</CCell>
        </TableRow>
        <TableRow>
          <CCell colSpan={2}>使用单位名称</CCell>
          <CCell colSpan={3}>{orc.使用单位}</CCell>
        </TableRow>
        <TableRow >
          <CCell  scope="row" colSpan={2}>管道使用地点</CCell>
          <CCell colSpan={3}>{orc.设备使用地点}</CCell>
        </TableRow>
        <TableRow>
          <CCell colSpan={2}>使用单位统一社会信用代码</CCell>
          <CCell>{orc.使用单位信用码}</CCell>
          <CCell>邮政编码</CCell>
          <CCell>{orc.使用单位邮编 || '／'}</CCell>
        </TableRow>
          <TableRow id={'Survey'}>
            <CCell  scope="row" colSpan={2}>安全管理人员</CCell>
            <CCell>{orc.安全员}</CCell>
            <CCell>联系电话</CCell>
            <CCell>{orc.安全员电}</CCell>
          </TableRow>
        </DirectLink>
        <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion#Conclusion`}>
          <TableRow>
            <CCell  scope="row" colSpan={2}>安全状况等级</CCell>
            <CCell>{orc.安全评定}</CCell>
            <CCell>下次年度检查日期</CCell>
            <CCell>{orc.新下检日}</CCell>
          </TableRow>
        </DirectLink>
      </TableBody>
    </Table>
    <Table  fixed={ ["11%","%"]  } css={ {borderCollapse: 'collapse' } } tight  miniw={800}>
        <TableBody>
          <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion#Conclusion`}>
          <TableRow >
            <CCell >检查依据</CCell>
            <CCell >《压力管道安全技术监察规程——工业管道》（TSG D0001-2009）<br/>
              《压力管道定期检验规则——工业管道》（TSG D7005-2018）</CCell>
          </TableRow>
          <TableRow>
            <CCell >问题及其处理</CCell>
            <Cell split={true} ><div css={{minHeight: '5rem', whiteSpace: 'pre-wrap'}}>
              [检查发现的缺陷位置、性质、程度及处理意见（必要时附图或附页）]<br/>
              {orc.问题及处 || '／'}
            </div></Cell>
          </TableRow>
          </DirectLink>
        </TableBody>
    </Table>
    {检验结论IndNj({theme, orc, rep})}
  </>;
};

